home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
systems
/
vm-cms
/
texshell
/
warning.xedit
< prev
next >
Wrap
Text File
|
1993-09-27
|
5KB
|
143 lines
/********************************************************************/
/* Package : TeXShell for CMS, version 2.0 */
/* Author : Humberto Jose' Bortolossi */
/* */
/* Bitnet : hjbortol at brlncc.bitnet, hjbortol at brfuem.bitnet */
/* Internet : hjbortol at gauss.impa.br */
/* */
/* Organizations : Instituto de Matematica Pura e Aplicada (IMPA) */
/* Fundacao Universidade Estadual de Maringa' */
/* */
/* Copyright : This program is freely distributable. */
/* You can do changes but, please, keep my name. */
/* */
/* Description : This macro will do two things: first, it will look */
/* up TEXLOG file searching for 'errors/warnings' */
/* messages. The respective lines will recorded into */
/* <fn> ERROR (for errors) and <fn> WARNING (for war- */
/* nings). Second, if you press <PF4> at LOGVIEW en- */
/* vironment, WARNING XEDIT will put the current line */
/* of <fn> TEX as the line where the error was found. */
/* This macro uses two temp files: TEXSHELL CONTROL1 */
/* and TEXSHELL CONTROL2. All temp files are erased */
/* when you go out LOGVIEW environment. */
/* */
/* (C) Copyright 1992 */
/********************************************************************/
parse arg fn .
set emsg off
'listfile' fn 'WARNING * (NOHEADER ALLOC STACK'
if rc /= 0 then do
call process(fn)
'execio 1 diskr TEXSHELL CONTROL2' FileMode '(FINIS'
parse pull CurrentError
DropBuf
end
'listfile' fn 'WARNING * (NOHEADER ALLOC STACK'
pull . . FileMode . . NumberOfErrors .
DropBuf
'execio 1 diskr TEXSHELL CONTROL2' FileMode '(FINIS'
parse pull CurrentError
DropBuf
if CurrentError >= NumberOfErrors then CurrentError = 0
CurrentError = CurrentError + 1
set emsg off; 'erase TEXSHELL CONTROL2' FileMode; set emsg on
'execio 1 diskw TEXSHELL CONTROL2' FileMode '(FINIS STRING' CurrentError
'execio' NumberOfErrors 'diskr' fn 'WARNING' FileMode '(FINIS'
do i = 1 to CurrentError - 1
pull .
end
pull LogLine SourceLine
DropBuf
queue 'sos tabcmdf'
queue 'top'
queue SourceLine
queue 'sos tabcmdf'
queue 'top'
queue LogLine
exit 0
process:
parse arg fn
set emsg off
'listfile' fn 'TEXLOG * (NOHEADER ALLOC STACK'
if rc /= 0 then do
say 'File' fn 'TEXLOG * not found.'
DropBuf
exit 0
end
else do
pull . . FileMode . . NumberOfLines .
end
DropBuf
'listfile' fn 'ERROR * (NOHEADER ALLOC STACK'
if rc /= 0 then do
DropBuf
end
else do
'erase' fn 'ERROR *'
end
DropBuf
'listfile' fn 'WARNING * (NOHEADER ALLOC STACK'
if rc /= 0 then do
DropBuf
end
else do
'erase' fn 'WARNING *'
end
DropBuf
set emsg on
'execio' NumberOfLines 'diskr' fn 'TEXLOG' FileMode '(FINIS'
do while queued() /= 0
parse pull Line
if subword(Line,1,2) = 'LaTeX Warning:' then do
LogLine = NumberOfLines - queued()
parse pull Line
do forever while substr(Line,1,2) /= 'l.'
parse pull Line
end
WarningLine = delstr(subword(Line,1,1),1,2)
OutRecord = right(LogLine,5) right(WarningLine,5)
'execio 1 diskw' fn 'WARNING' FileMode '(FINIS STRING' OutRecord
end
if subword(Line,1,1) = '!' then do
LogLine = NumberOfLines - queued()
parse pull Line
do forever while substr(Line,1,2) /= 'l.'
parse pull Line
end
ErrorLine = delstr(subword(Line,1,1),1,2)
OutRecord = right(LogLine,5) right(ErrorLine,5)
'execio 1 diskw' fn 'ERROR' FileMode '(FINIS STRING' OutRecord
end
end
DropBuf
set emsg off
'erase TEXSHELL CONTROL1 *'
'erase TEXSHELL CONTROL2 *'
Junk = 0
'execio 1 diskw TEXSHELL CONTROL1' FileMode '(FINIS STRING' Junk
'execio 1 diskw TEXSHELL CONTROL2' FileMode '(FINIS STRING' Junk
'listfile' fn 'WARNING' FileMode '(NOHEADER ALLOC STACK'
if rc /= 0 then do
DropBuf
say 'No warnings ...'
exit 0
end
DropBuf
return